#include<stdio.h>
#include <stdint.h>


#include <math.h>
int32_t sine_wave(int16_t hz, int16_t k) {
    static int32_t idx = 0;
    float radian = 0;
    idx = (idx+1)%100;
    radian = (float)idx;
    radian = radian / (float)hz;
    radian = 2 * 3.14 * radian;
    return (int32_t)(k * sin(radian));
}


int main()
{
    for (int i=0; i<100; i++) {
        sine_wave(100, 1000);
        printf("%d\r\n", sine_wave(100, 1000) );
    }
    
}

